package org.spring.boot.jdbctemplate.dao;

import org.spring.boot.jdbctemplate.dto.Tmptab;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: eastcom
 * @desc:
 **/
@Repository
public class TmptabDaoImpl implements TmptabDao {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<Tmptab> queryForList() {
		String sql = "SELECT * FROM FM.TMP_TAB";
		return this.jdbcTemplate.query(sql,
				new BeanPropertyRowMapper<>(Tmptab.class));
	}
}
